import request from "./httpUtil.js"
import config from "./config.js"

const apis = {};

apis.login = (params) => request.post(config.apiUrl.login, params);
apis.updateUserInfo = (params) => request.put(config.apiUrl.updateUserInfo, params);
apis.getRecommendDynamic = (params) => request.getNoLoading(config.apiUrl.recommendDynamic, params);
apis.getFollowDynamic = (params) => request.getNoLoading(config.apiUrl.followDynamic, params);
apis.getComments = (params) => request.getNoLoading(config.apiUrl.getComments, params);
apis.publishDynamic = (params) => request.post(config.apiUrl.publishDynamic, params);
apis.uploadFiles = (params) => request.uploadFiles(config.apiUrl.uploadFile, params);
apis.uploadFile = (params) => request.uploadFile(config.apiUrl.uploadFile, params);
apis.getNearlyActivity = (params) => request.getNoLoading(config.apiUrl.nearlyActivity, params);
apis.getRecommendActivity = (params) => request.getNoLoading(config.apiUrl.recommendActivity, params);
apis.getActivityDetail = (params) => request.get(config.apiUrl.activityDetail + params.id, {});
apis.getUserInfo = (params) => request.getNoLoading(config.apiUrl.userInfo, params);
apis.likeOrJoinActivity = (params) => request.post(config.apiUrl.likeOrJoinActivity, params);
apis.deleteActivityUsers = (params) => request.delete(config.apis.likeOrJoinActivity, params);
apis.getMyPublishActivities = (params) => request.getNoLoading(config.apiUrl.myPublishActivities, params);
apis.getMyConcernActivities = (params) => request.getNoLoading(config.apiUrl.myConcernActivities, params);
apis.publishActivity = (params) => request.post(config.apiUrl.publishActivity, params);
apis.updateActivity = (params) => request.put(config.apiUrl.publishActivity, params);
apis.deleteActivity = (params) => request.delete(config.apiUrl.publishActivity, params);
apis.getPassiveList = (params) => request.getNoLoading(config.apiUrl.passiveList, params);
apis.feedback = (params) => request.post(config.apiUrl.feedback, params);
apis.changePassword = (params) => request.put(config.apiUrl.changePassword, params);
apis.getShopDetail = (params) => request.getNoLoading(config.apiUrl.shopDetail + '/' + params.id, {});
apis.createShop = (params) => request.post(config.apiUrl.shopDetail, params);
apis.updateShop = (params) => request.put(config.apiUrl.shopDetail, params);
apis.transferShop = (params) => request.put(config.apiUrl.shopDetail + '?newMaster=' + params.newMaster, {});
apis.getMyDynamic = (params) => request.getNoLoading(config.apiUrl.myDynamic, params);
apis.click = (params) => request.postNoLoading(config.apiUrl.click + '?entityType=' + params.entityType + '&entityId=' + params.entityId, {});
apis.checkUser = (params) => request.getNoLoading(config.apiUrl.checkUser, params);
apis.comment = (params) => request.postNoLoading(config.apiUrl.comment, params);
apis.followUser = (params) => request.postNoLoading(config.apiUrl.followUser, params);
apis.getFollowOrFans = (params) => request.getNoLoading(config.apiUrl.followOrFans, params);
apis.getNoticeCount = (params) => request.getNoLoading(config.apiUrl.noticeCount, params);
apis.getNoticeList = (params) =>  request.getNoLoading(config.apiUrl.noticeList, params);
apis.searchActivity = (params) => request.get(config.apiUrl.searchActivity, params);
apis.getMessageList = (params) => request.getNoLoading(config.apiUrl.messageList, params);
apis.hotSearch = (params) =>  request.getNoLoading(config.apiUrl.hotSearch, params);

export default apis;
